/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * The software in this package is published under the terms of the GPL v2.0
 * license, a copy of which has been included with this distribution in the
 * LICENSE-GPL.txt file.
 */

package org.cemantika.management.drools;

import java.util.List;

import org.cemantika.exception.KnowledgeSessionNotCreatedException;
import org.cemantika.management.ContextualManipulation;

/**
 * IDroolsContextualManipulation represents the interface with the methods of the contextual
 * manipulation with the Drools framework.
 * 
 * @author andersonfellipe
 */
public interface IDroolsContextualManipulation extends ContextualManipulation {
    
    /**
     * Return all types inserted into Drools session.
     * 
     * @return the list with the name of the classes.
     */
    public List<String> getFactTypes();

    /**
     * Represents the test if there is at least one class inserted into Drools session of this
     * type.
     * 
     * @param focusType the name of the class.
     * @return true if it has a focus of this type into session.
     */
    public boolean hasFocusOfType(String focusType);

    /**
     * Starts the rule engine with forward chaining.
     */
    public void startRules() throws KnowledgeSessionNotCreatedException;
    
    /**
     * Starts the rule engine with forward chaining that is executed forever until the halt of the session or of the application.
     */
    public void startRulesForever() throws KnowledgeSessionNotCreatedException;
    
    /**
     * Stops the rule engine and the forward chaining execution.
     */
    public void stopRules() throws KnowledgeSessionNotCreatedException;

}
